{% extends "CommonLibraryBundle::base.html.twig" %}

{% form_theme form ':form:form_bootstrap.html.twig' %}

{% block stylesheets %}
    {{ parent() }}
    <link type="text/css" rel="stylesheet" href="{{asset('css/theme.css')}}" />
{% endblock %}

{% block javascripts %}
    {{parent()}}
{% endblock %}

{% block titre %}
    Thème
{% endblock %}

{% block titresmall %}
    {% if app.request.attributes.get('_route') == 'common_library_theme_edit' %}
        {% if(themeParent is not null) %}
            {{ "Ajout d'un sous-thème à "~themeParent.nom }}
        {% else %}
            Ajout d'un thème
        {% endif %}
    {% else %}
        Modification d'un thème
    {% endif %}
{% endblock %}

{% block subbody %}
    <form id="formTheme" action="" method="post" class=""{{ form_enctype(form) }}>
        <div class="well">
            {{ form_row(form.nom, {'label': 'Nom'}) }}
            {{ form_row(form.theme, {'label': 'Thème Parent'}) }}
        </div>
        {{ form_rest(form) }}
        <br>
        <div class="text-center">
            <button class="btn btn-success" type="submit">Valider</button>
            {% if(themeParent is not null) %}
                <a href="{{ path('common_library_theme_index_1', {'idTheme': themeParent.id}) }}" class="btn btn-danger text-center">Retour</a>
            {% else %}
                <a href="{{ path('common_library_theme_index') }}" class="btn btn-danger text-center">Retour</a>
            {% endif %}
        </div>
    </form>
{% endblock %}